package com.syni.mdd.sjb.common.datatreaure.controller.protect;


import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckUserIdentity;
import com.syni.mdd.sjb.common.datatreaure.controller.BaseController;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.BaseRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.dxshAppNews.ReceivedNewsVo;
import com.syni.mdd.sjb.common.datatreaure.service.DxshAppNewsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 电享生活app消息表 前端控制器
 * </p>
 *
 * @author cfx
 * @since 2020-04-21
 */
@RestController
@RequestMapping("/dxshAppNews")
public class DxshAppNewsController extends BaseController {

    @Autowired
    DxshAppNewsService dxshAppNewsService;

    @PostMapping("/receivedNews")
    @ApiOperation(value = "获取我的通知")
    @CheckUserIdentity
    public Map<String,Object> receivedNews(@RequestBody @Validated ReceivedNewsVo receivedNewsVo){
        return dxshAppNewsService.receivedNews(receivedNewsVo);
    }


    @PostMapping("/clearNews")
    @ApiOperation(value = "清空我的通知")
    @CheckUserIdentity
    public Map<String,Object> clearNews(@RequestBody @Validated BaseRqVo baseRqVo){
        return dxshAppNewsService.clearNews(baseRqVo);
    }
}
